//
//  PullRefresh.m
//  Travelling
//
//  Created by lanou on 15/12/16.
//  Copyright © 2015年 Morrrah. All rights reserved.
//

#import "PullRefresh.h"

@implementation PullRefresh

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _loadView = [[UIView alloc]initWithFrame:frame];
        UILabel *loadLabel = [[UILabel alloc]initWithFrame:frame];
        loadLabel.text = @"点击加载更多";
        loadLabel.textAlignment = NSTextAlignmentCenter;
        [_loadView addSubview:loadLabel];
        
        _loadingView = [[UIView alloc]initWithFrame:frame];
        UILabel *loadingLabel = [[UILabel alloc]initWithFrame:frame];
        loadingLabel.text = @"正在加载...";
        loadingLabel.textAlignment = NSTextAlignmentCenter;
        [_loadingView addSubview:loadingLabel];
        
        _activityView = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
        _activityView.center = CGPointMake(ScreenWidth / 2.0 + 60, 15);
        [_activityView startAnimating];
        [_loadingView addSubview:_activityView];
    }
    return self;
}


@end
